﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace schedule
{
    public partial class Category1 : Form
    {
        private String categoryName;
        private bool isCateg1Selected = false;
        private bool isSearch;

        public Category1()
        {
            InitializeComponent();
        }

        public Category1(bool isSearch)
        {
            InitializeComponent();
            this.isSearch = isSearch;
        }

        public bool getCateg1Selected()
        {
            return isCateg1Selected;
        }

        private void btn_CategCulture_Click(object sender, EventArgs e)
        {
            Category2 f = new Category2(isSearch);
            f.SetType("culture");
            f.ShowDialog();
            if (f.getIsCateg2Selected())
            {
                categoryName = f.getCategoryName();
                isCateg1Selected = true;
                
            }
            this.Close();
        }

        private void btn_CategStudy_Click(object sender, EventArgs e)
        {
            Category2 f = new Category2(isSearch);
            f.SetType("study");
            f.ShowDialog();
            if(f.getIsCateg2Selected())
            {
                categoryName = f.getCategoryName();
                isCateg1Selected = true;
                
            }
            this.Close();
        }

        private void btn_CategSport_Click(object sender, EventArgs e)
        {
            Category2 f = new Category2(isSearch);
            f.SetType("sport");
            f.ShowDialog();
            if(f.getIsCateg2Selected())
            {
                categoryName = f.getCategoryName();
                isCateg1Selected = true;
                
            }
            this.Close();
        }

        private void btn_CategGame_Click(object sender, EventArgs e)
        {
            Category2 f = new Category2(isSearch);
            f.SetType("game");
            f.ShowDialog();
            if(f.getIsCateg2Selected())
            {
                categoryName = f.getCategoryName();
                isCateg1Selected = true;
                
            }
            this.Close();
        }

        public void setCategoryName(String categoryName)
        {
            this.categoryName = categoryName;
        }

        public String getCategoryName()
        {
            return categoryName;
        }
    }
}
